//
//  ViewController.swift
//  API
//
//  Created by ET|冰琳 on 2017/3/23.
//  Copyright © 2017年 IB. All rights reserved.
//

import UIKit
import MappingAce
import Alamofire
import EventKit


extension Path {
    static let login: Path        = "loginController.do?appLogin"
}

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        let request = URLRequest(url: URL(string: "https://www.baidu.com")!)
        
        let data = URLSession.shared.dataTask(with: request) { (data, req, err) in
            
        }
        data.resume()
        
        let red = UIView()
        red.backgroundColor = UIColor.orange
        self.view.addSubview(red)
        red.translatesAutoresizingMaskIntoConstraints = false
        
        
        let server  = Server(scheme: "http", host: "crm.uoko.com:8081", basePath: "/ukcrm")
        let url     = server.url(.login)
        
        let server1 = Server(scheme: "http", host: "crm.uoko.com:8081", basePath: "/ukcrm")
        let url1    = server1.url(.login)
        
        let horizontal = NSLayoutConstraint.constraints(withVisualFormat: "H:|[images]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["images": red]);
        
        let vertical   = NSLayoutConstraint.constraints(withVisualFormat: "V:|-[images]-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["images": red]);
        
        self.view.addConstraints(horizontal)
        self.view.addConstraints(vertical)
    }
}

